package com.itheima.admin.controller;


import com.baomidou.mybatisplus.extension.service.IService;
import com.itheima.admin.dto.ChannelPageRequestDto;
import com.itheima.admin.dto.SensitivePageRequestDto;
import com.itheima.admin.pojo.AdChannel;
import com.itheima.admin.pojo.AdSensitive;
import com.itheima.admin.service.AdSensitiveService;
import com.itheima.common.vo.PageResultVo;
import com.itheima.common.vo.ResultVo;
import com.itheima.core.controller.AbstractCoreController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Api(tags = "敏感词汇管理")
@RequestMapping("/sensitive")
@RestController
public class AdSensitiveController extends AbstractCoreController<AdSensitive> {

    @Autowired
    private AdSensitiveService adSensitiveService;


    @Autowired
    public AdSensitiveController(AdSensitiveService adSensitiveService) {
        super(adSensitiveService);
        this.adSensitiveService = adSensitiveService;
    }


    /**
     * 查询分页数据和按名字模糊查询
     * @param dto
     * @return
     */
    @ApiOperation("频道分页搜索")
    @PostMapping("/list")
    public ResultVo<AdSensitive> findPage(@RequestBody SensitivePageRequestDto dto){

        System.out.println("dto======================"+dto);
        PageResultVo<AdSensitive> resultList = adSensitiveService.findPage(dto);

        System.out.println("resultList========="+resultList);

        return resultList;
    }
}
